package com.iwdnb.gkgz.controller;

import java.util.concurrent.Executor;

import com.iwdnb.bmnf.common.model.result.Result;
import com.iwdnb.bmnf.common.service.CacheService;
import com.iwdnb.gkgz.application.service.HistoryDataService;
import com.iwdnb.gkgz.application.service.StockDayDataSerivce;
import com.iwdnb.gkgz.application.service.StockService;
import com.iwdnb.gkgz.common.utils.StockBlackListUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 股票黑名单数据处理
 *
 **/
@RestController
@RequestMapping("/api/stock/black")
@Slf4j
public class StockBlackController {

    @Autowired
    private Executor executor;
    @Autowired
    HistoryDataService historyDataService;
    @Autowired
    private StockDayDataSerivce stockDayDataSerivce;
    @Autowired
    private StockService stockService;
    @Autowired
    private CacheService cacheService;



    @RequestMapping("/initBlackStockList")
    public Result<String> initBlackStockList() {
        StockBlackListUtils.initBlackStockList();
        return Result.getSuccessResult(null);
    }

    @RequestMapping("/addBlackStock")
    public Result<String> addBlackStock(String codes) {
        StockBlackListUtils.addBlackStock(codes);
        return Result.getSuccessResult(null);
    }

    @RequestMapping("/getBlackStockList")
    public Result<String> getBlackStockList() {
        return Result.getSuccessResult(StockBlackListUtils.getBlackStockList());
    }


}
